package com.sz.stock.mapper;

import com.sz.stock.model.StockBuyOrSale;
import com.sz.stock.model.StockBuyOrSaleExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.springframework.stereotype.Component;

@Component
public interface StockBuyOrSaleMapper {
    int countByExample(StockBuyOrSaleExample example);

    int deleteByExample(StockBuyOrSaleExample example);

    int deleteByPrimaryKey(Integer stockBSId);

    int insert(StockBuyOrSale record);

    int insertSelective(StockBuyOrSale record);

    List<StockBuyOrSale> selectByExample(StockBuyOrSaleExample example);

    @Select("SELECT * FROM T_STOCK_BUYORSALE WHERE STOCK_CODE=#{param1} AND STOCK_B_S_TYPE=#{param2} AND ROWNUM <6 ORDER BY STOCK_B_S_PRICE asc")
    List<StockBuyOrSale> selectFive(String code, String type);

    @Select("SELECT * FROM T_STOCK_BUYORSALE WHERE STOCK_CODE=#{param1} AND STOCK_B_S_TYPE=#{param2} ORDER BY STOCK_B_S_PRICE desc")
    List<StockBuyOrSale> selectAll(String code, String type);

    StockBuyOrSale selectByPrimaryKey(Integer stockBSId);

    int updateByExampleSelective(@Param("record") StockBuyOrSale record, @Param("example") StockBuyOrSaleExample example);

    int updateByExample(@Param("record") StockBuyOrSale record, @Param("example") StockBuyOrSaleExample example);

    int updateByPrimaryKeySelective(StockBuyOrSale record);

    int updateByPrimaryKey(StockBuyOrSale record);
}